import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/api/v1/login',
    method: 'post',
    data
  })
}

// 获取管理员列表
export function userListAPI(params) {
  return request({
    url: '/api/v1/getlist',
    method: 'get',
    params
  })
}

export function getInfo() {
  return request({
    url: '/admin/admin/querymyinfo',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/admin/admin/logout',
    method: 'get'
  })
}

// 获取管理员列表
export function getInfoAPI(params) {
  return request({
    url: '/admin/admin/queryadmins',
    method: 'get',
    params
  })
}


export function addUserApI(data) {
  return request({
    url: '/api/v1/insertUser',
    method: 'post',
    data
  })
}

export function updateUserApI(data) {
  return request({
    url: '/api/v1/updateUser',
    method: 'post',
    data
  })
}

export function deleteUserApI(params) {
  return request({
    url: '/api/v1/deleteUser',
    method: 'get',
    params
  })
}

